﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
	CodeBehind="Index.aspx.cs" Inherits="Habito.Reference.Index" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Habito Contruction Chemicals Company-References
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
	<script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>
	<link href="../Content/Site.css" rel="stylesheet" type="text/css" />
	<link href="../Content/icon.css" rel="stylesheet" type="text/css" />
	<link href="../Content/easyui.css" rel="stylesheet" type="text/css" />
	<script src="../Scripts/common.js" type="text/javascript"></script>
	<script src="../Scripts/jquery.jbind.js" type="text/javascript"></script>
	<script src="../Scripts/jquery.treeTable.js" type="text/javascript"></script>
	<script type="text/javascript" src="../Scripts/jquery.easyui.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function () {
			$.ajax({
				cache: false,
				url: "Index.aspx" + "?GetAllReference=1",
				success: function (data) {
					data = $.evalJSON(data);
					$("#logList").treeTable({
						treeColumn: -1,
						key: "ID",
						bind: {
							templateID: "#logList_bt",
							data: data,
							ajaxPara: {},
							ajaxSuccess: function (re) { }
						}
					});
				}
			});
			if ($("#currentID").val() != "" && $("#currentID").val() != undefined) {
				$.ajax({
					cache: false,
					url: "Index.aspx" + "?Getcontent=1",
					data: { id: $("#currentID").val() },
					success: function (data) {
						if (data != null) {
							data = $.evalJSON(data);
							$("#InnerDIV").html(data.Description);
							$("#listDIV").css('display', 'none');
							$("#content").css('display', 'block');
						}
					}
				});
			}

		});
		function ShowDetail(id) {
			$.ajax({
				cache: false,
				url: "Index.aspx" + "?Getcontent=1",
				data: { id: id },
				success: function (data) {
					if (data != null) {

						data = $.evalJSON(data);
						$("#InnerDIV").html(data.Description == null ? "" : data.Description);
						$("#listDIV").css('display', 'none');
						$("#content").css('display', 'block');
					}
				}
			});
		}
		function ShowlistDIV() {
			$("#listDIV").css('display', 'block');
			$("#content").css('display', 'none');
		}
			
	</script>
	<style type="text/css">
		.link:hover { text-decoration: none; }
	</style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
	<input type="hidden" name="" value="<%=ViewState["id"] %>" id="currentID" />
	<div style="width: 220px; padding-left: 30px; position: absolute; text-align: left;"
		class="solution">
		<ul style="list-style: none">
			<li class="link ">Our References</li>
		</ul>
	</div>
	<div id="listDIV" style="width: 716px; text-align: left; margin-left: 250px; position: absolute">
		<table id="logList" style="width: 630px;">
			<thead>
				<tr>
					<th>YEAR</th>
					<th>PROJECT REFERENCE</th>
					<th>CITY</th>
				</tr>
				<tr id='logList_bt' style="display: none">
					<td>{RYear}</td>
					<td>
						<span style="cursor: pointer; color: #006fa1" onclick="ShowDetail('{ID}')">{ProjectName}</span>
					</td>
					<td>{City}</td>
				</tr>
			</thead>
		</table>
	</div>
	<div id="content" style="display: none; width: 716px;  height:85%; text-align: left;
		margin-left: 250px; position: absolute">
		<div id="title" style="width: 100%">
			<span onclick="ShowlistDIV()" style="cursor: pointer; font-size: 11px; color: #006fa1">
				&lt;&nbsp;Back to References</span>
			<hr />
			<br />
			<div id="InnerDIV" style="width: 100%; overflow: auto">32</div>
		</div>
	</div>
</asp:Content>
